<template>
  <div class="favoritesContainer">
    <nav-bar @clickBarItem="clickBarItem" :navBarItem="navBarData"></nav-bar>
    <router-view class="favorites"></router-view>
  </div>
</template>

<script>
import NavBar from "../../../components/NavBar/NavBar";
export default {
name: "favoritesIndex",
  data(){
  return{
        navBarData: [
        { name: "专辑", path: "/favorites/favoriteAlbum" },
        { name: "歌手", path: "/favorites/favoriteSinger" },
        { name: "视频", path: "/favorites/favoriteVideo" },
      ],
  }
  },
    methods: {
    // 事件
    //   点击navbaritem的回调
    clickBarItem(path) {
      this.$router.push(path);
    },
  },
    created() {
    if (!this.$store.state.MusicStore.isLogin) {
      layer.msg('请先登录',{
        icon:7,
        time:1000
      })
      this.$router.replace("/media/music");
    }
  },
}
</script>

<style scoped lang="less">
.favoritesContainer {
  padding: 0 !important;
  overflow-y: hidden;
  .favorites {
  margin: auto;
  height: calc(80vh - 165px);
  overflow-y: scroll;
}
}
</style>
